package com.test.model;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class Student implements Writable{
	private String name;
	private int score;
	
	public Student() {
		this.name = "";
		this.score = 0;
	}
	
	public Student(String name, int score) {
		this.name = name;
		this.score = score;
	}

	@Override
	public void readFields(DataInput dataInput) throws IOException {
		this.name = dataInput.readUTF();
		this.score = dataInput.readInt();
	}
	

	@Override
	public void write(DataOutput dataOutput) throws IOException {
		dataOutput.writeUTF(name);
		dataOutput.writeInt(score);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}
	
}
